const type = {
    'string': '[object String]',
    'number': '[object Number]',
    'boolean': '[object Boolean]',
    'function': '[object Function]',
    'array': '[object Array]',
    'object': '[object Object]',
    'date': '[object Date]',
    'null': '[object Null]',
    'undefined': '[object Undefined]'
}
const typeOf = (v,t) => Object.prototype.toString.call(v)=== type[t]

export const utils = {
    isArray: v => typeOf(v,'array'),
    isBoolean: v => typeOf(v,'boolean'),
    isString: v => typeOf(v,'string'),
    isNumber: v => typeOf(v,'bumber'),
    isFunction: v => typeOf(v,'function'),
    isObject: v => typeOf(v,'object'),
    isDate: v => typeOf(v,'date'),
    isNull: v => typeOf(v,'null'),
    isUndefined: v => typeOf(v,'undefined'),
}
export default utils

